version: "3.9"

services:
  postgres:
    image: postgres:14-alpine
    container_name: postgres.social
    restart: always
    ports:
      - "5432:5432"
    volumes:
      - postgres:/var/lib/postgresql/data
    environment:
      POSTGRES_DB: ${POSTGRES_DB}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
      POSTGRES_USER: ${POSTGRES_USER}
    networks:
      - main

networks:
  main:
    name: social
    driver: bridge

volumes:
  postgres: